import React, { Fragment } from 'react';
import { Button, Row, Col } from 'antd';
import Result from '@/components/Result';
import styles from './style.less';

class Finish extends React.PureComponent {
  render() {
    const { resultInfo, downLoadIncrease, closeUpdate } = this.props;
    const information = (
      <div className={styles.information} style={{ lineHeight: '32px' }}>
        <Row>
          <Col span={5} className={styles.label}>
            原采集人员：
          </Col>
          <Col span={8}>{resultInfo.collectEmpNumOld}人</Col>
        </Row>
        <Row>
          <Col span={5} className={styles.label}>
            新采集人员：
          </Col>
          <Col span={12}>
            {resultInfo.collectEmpNumNew}人,其中：增员{resultInfo.collectAddEmpNum}人减员
            {resultInfo.collectDeduEmpNum}人
          </Col>
        </Row>
        <Row style={{ textAlign: 'center', justifyContent: 'center' }}>
          <Button type="primary" onClick={() => downLoadIncrease()}>
            下载增员
          </Button>
        </Row>
      </div>
    );
    const actions = (
      <Fragment>
        <Button onClick={() => closeUpdate()}>关闭</Button>
      </Fragment>
    );
    return (
      <Result
        type={resultInfo.errorCount ? null : 'success'}
        title={resultInfo.errorCount ? null : '更新成功'}
        extra={information}
        actions={actions}
        className={styles.result}
      />
    );
  }
}

export default Finish;
